package com.egu.web.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.egu.model.CustomerCare;
import com.egu.model.NoticeInfo;
import com.egu.service.WorkbenchService;

@Controller
@RequestMapping("workbench")
public class WorkbenckController {

	@Autowired
	private WorkbenchService workbenchService;

	@RequestMapping("listUI")
	public String listUI() {
		return "workbench/listUI";
	}

	@RequestMapping("getCustomerCareList")
	@ResponseBody
	public List<CustomerCare> getcustomerCareList() {
		Map<String, Object> map = workbenchService.getWorkbenchUI();
		@SuppressWarnings("unchecked")
		List<CustomerCare> list=(List<CustomerCare>) map.get("customerCareList");
		return list;
	}
	@RequestMapping("getNoticeList")
	@ResponseBody
	public List<NoticeInfo> getNoticeList() {
		Map<String, Object> map = workbenchService.getWorkbenchUI();
		@SuppressWarnings("unchecked")
		List<NoticeInfo> list=(List<NoticeInfo>) map.get("noticeInfoList");
		return list;
	}
	

}
